Hack My House: UL certified and use ESP8266 to turn on the lights | Hack My House

2021-11-26 07:35:46 By : Ms. Tina Kong

It is hard to imagine a smart home without smart lighting. It may be laziness, but the ability to turn the lights on or off without going to the switch is a must, especially when there is a sleeping baby on the lap. It is tempting to pack relays into electrical boxes and use Raspberry Pi or microcontroller GPIO to control them. Although it is tempting, if you get it wrong, there is a real fire hazard. A better choice is one of the integrated WiFi switches. Sonoff is probably the most famous brand, producing a full range of equipment based on ESP8266. These devices are powered by the main power source and connect to your network via WiFi. One disadvantage of Sonoff devices is that they can only work when connected to Sonoff's cloud.

The light switch locked to the cloud provider is unacceptable. Enter the Tasmota that we introduced before. Tasmota is an open source firmware specially designed for Sonoff switches, but supports various ESP8266-based devices. Tasmota will not connect to any cloud provider unless you tell it, and it can be fully controlled from within the local network.

We are very familiar with some of the pitfalls of imported electronic products, but one of the lesser-known problems is the lack of certification. In the United States, there are several nationally recognized testing laboratories: Underwriters Laboratories (UL) and Intertek (ETL) are the most prominent. Many imported electronic equipment, including Sonoff equipment, do not have these certifications. If the worst happens and an electrical fire occurs, the problem is responsibility. There are many different opinions on the importance of certification on the Internet-the lack of a certification mark is somewhere between meaningless and completely dangerous. The most common claim is that the combination of a house fire and the installation of non-certified equipment will cause the insurance company to refuse payment.

Instead of repeating this certainly wise advice from the Internet, I asked my insurance agent about uncertified equipment in the event of a fire. I have found that insurance agencies avoid giving clear answers regarding the payment of claims. The response received was "it depends": the homeowner's insurance covers accidents and emergencies. If the homeowner knows that they are using uncertified equipment, they can classify it as "non-accident". So far, this myth seems reasonable. The insurance company’s final answer: devices that are not UL certified may cause claims to be denied, but it depends on the insurance policy and other details-why take the risk? The certification mark makes insurance companies happier.

I also discussed this issue with the electrical inspector in my city. He commented that when hardwired uncertified equipment into the house, it violated electrical codes. He responded to the warning that the insurance company may refuse to pay, but added that in the event of an injury, there may be more liability issues. I choose to use certified equipment at home. You must decide for yourself what device you are willing to use.

There are some devices on Amazon that claim to have certification, but searching the certification database leads me to believe that not all of these claims are valid. If in doubt, there is a searchable UL database and a searchable Intertek database.

So let's review our requirements: we need a WiFi-connected switch, supported by Tasmota, and listed UL or ETL. So far, I have found equipment that fully meets these standards. EtekCity ESWL01 has passed Intertek certification, it is relatively easy to flash to Tasmota, and can even be installed on the Decora board. I also received confirmation that Shelly has applied for UL certification and hope that the certification can be approved as soon as possible. Once certified, they will also make a good choice.

Using a TTL serial connection to make the switch blink is very simple. First, do not connect the switch to the main power source when handling internal components. It will shock you, which is bad, but it is very possible to feed the power supply voltage into your serial port, which is worse. Instead, we will use the power pin on the serial adapter to power the device. Please note that this is not an RS 232 serial port, but a 3.3 V TTL level serial connection. I use the MM232R module, but any TTL serial adapter will work, including Raspberry Pi.

To put the device in blinking mode, short GPIO0 to ground when connecting power. There are many flashing tools, but Esptool seems to be the easiest, you can flash with just one command. The official recommendation is to back up the factory firmware, reset ESP8266, and then flash the firmware. I don’t think there is any need to take additional steps, but if you encounter problems, please remember.

I used the published Tasmota binaries, but if you prefer to compile them yourself, instructions are provided. One advantage of compilation is that you can bake your WiFi information and other settings directly into a binary file. If you do not add WiFi information, the module will broadcast the open WiFi network you can connect to for your configuration. Set up your WiFi information and make sure to choose a useful hostname as we will use it to control the switch.

The device will restart and should connect to your network. The last configuration step is to tell Tasmota which device it is running on. We will use the template function to define important GPIOs.

Tasmota can be controlled through a web interface, MQTT or REST API, where commands are sent as HTTP GET and HTTP POST requests. We will use this REST interface. Once the switch flashes and is connected to your WiFi, follow the manufacturer's instructions to reassemble and install it.

We will start by building a simple PHP control interface, lights_api.php. This extra layer is important when isolating IoT networks, which means that only one HTML connection is needed to control everything.

This allows us to make a simple HTML request, such as "lights_api.php?device=entry-light-1", and receive a JSON object with the current state of the device. The POST message allows the switch state to be switched.

You may remember that we use the Raspberry Pi touch screen as one of our main interfaces. This interface is only 800 x 480, which is a considerable design challenge for the user interface. I used Libreoffice Draw to draw a rough plan of my house and exported it as SVG. On this image, we will draw icons to represent controllable lights.

There are some tricks here. The img element contains the complete definition of each switch. The updateAll() function traverses all elements of the class "light", gets the status of each switch and updates the graph. The ID of each img contains the host name of the switch, as well as the indicator of the GPIO that we are interested in, allowing devices that support the control of multiple lights. The update() function runs on each img element, using the information embedded in the ID to request the switch state from our PHP interface.

We also define the onclick of each img, which provides us with the touch screen function. After sending the switch request, we will also force to update the light to keep the interface synchronized. I will leave it as an exercise for the reader to write the img element in PHP and add the database backend.

With this, we have a simple touch screen interface to control the lighting. It is suitable for mobile phones or desktop computers, so there is no need to wake up the baby to turn off the lights. It is also a simple interface for further programming. Want the hallway lights to light up when the front door opens? Just add an HTTP GET request to the handler script.

Each room has a Raspberry Pi and the lighting is controlled. I have a good start for a smart home. There are still some items on my wish list, but I want to hear your opinion. I have not introduced what do you think are the essential functions of a smart home?

Will flashing the device with your own firmware invalidate the UL certification?

As far as I know, no. This certification applies to hardware. The company will not recertify every software update.

It depends on the certificate! Is it UL fire or electrical safety certification? maybe not. Is it the UL 2900 cyber security series? Then it must be. My favorite way of thinking is "Will connecting 6 UL-certified batteries in serial invalidate the certificate?" The answer is yes, yes, absolutely yes, yes. Each certificate has certificate conditions. You can find certificates publicly and see which ones are allowed and which ones are not allowed.

Uh, click report again when I want to click reply. sorry.

When the software is not part of the certified content, certification is almost useless. Flashing the firmware to the device, for example, the fast "strobe" relay is turned on and off, and the software is a fire hazard, even if the device is otherwise reasonable and provably safe.

I want to test this with a relay!

I want to see if anyone can give a specific example (in the United States) where someone uses non-UL certified equipment and if it causes a fire, the insurance company refuses to pay. Oops, I bought some CFL bulbs from Wal-Mart (under their Great Value store label) a few years ago. These bulbs are made in China and do not have UL (or any other) certification.

Now Australia is a completely different thing. Obviously, doing any electrical work without government permission is actually a crime, including only replacing light switches or even replacing the power cords on devices that can be plugged into a power source. If you suffer a loss when you commit a "crime," then the insurance will not cover it. Jonathan Oxer has an interesting video about DIY electrical work: https://www.youtube.com/watch?v=3K9QjRDIwuw

There are many examples of people being killed by non-UL certified power supplies.

An example of a fire is all fires caused by hoverboards. When people are killed/injured, some of them end up in complicated lawsuits. I don't know what the results of the trials are, or whether they are still in progress.

By the way, since UL certification is being enforced on the hoverboard, I haven't seen any fire reports.

Shouldn't customs prevent the import of garbage?

But whether there are any applicable insurance payments is the question. If they are to be plugged into a power source, I actually always look for something listed by UL, especially if it stays plugged in all the time. If it comes from China, I even suspiciously pay attention to UL listed items (it may be fake, or if it is not, there is no guarantee that what you buy is what they send to UL for testing). This is the main reason why I refuse to use Sonoff devices, although I haven't heard of any obvious problems with them.

There are many examples of people being killed by UL-certified power supplies.

Any modification of intentional radiators or equipment connected to hazardous voltages, safety and EMC certifications will no longer be valid. Please refer to 29CFR1910 and 47CFR15.

Not sure if OSHA regulations apply to home wiring. I am more interested in the content of the international housing code.

I am not very familiar with EMC in the United States, but I can imagine that if you want to refresh the third-party firmware on the device, the FCC certificate (used for intentional radiators) might become invalid?

Three examples of this can be provided-one of which is that my neighbor’s insurance company refused to compensate for his garage fire damage because he used a self-made compressor AC power controller.

The other two are company; that is, all equipment connected to AC power must carry the mandatory requirements of the NRTL mark; and all NRTL certifications require testing laboratories to "enforce" their mark. OSHA regulations do not cover the items in your home, so any requirements for NRTL certified items fall within the scope of the personal home insurance policy.

I am pretty sure that NEC needs residential certification. In other words, most houses do not fully comply with the code in some respects. This is important if you get a license.

simple. Certified equipment can meet your needs, but it is usually not available or affordable. And they are always not self-made.

"Not sure if OSHA regulations apply to home wiring. I am more interested in the content of the International House Code."

The question is not whether OSHA regulations apply to residential buildings, but whether any changes will affect the NRTL mark. The electrical part of IRC is basically NFPA70, which has been completely rejected elsewhere and will never be adopted outside of North America and the U.S. Protectorate.

CSA, ETL, TUVR, UL, etc. all have a very clear and legally accurate statement on the scope and validity of the certification of equipment (including external markings) modified in any way.

If you want ETL certified, ESP-based dimmer resale, I can put you in touch with the manufacturer who has all the appropriate paperwork.

ETL link from the manufacturer...

Our model is D6932, based on ESP32 dimmer, you can verify it in the ETL link above. https://ramuk.intertekconnect.com/WebClients/ITS/DLP/products.nsf/

"I'm pretty sure NEC requires residential certification. That is, most houses do not fully comply with the code in some respects. This is important if you get a permit."

NEC (usually NFPA70) is a building code. It has no practical use in equipment certification, because there are no material requirements and performance requirements, and there is no type test requirement in the NFPA standard. Various NFPA standards point out many ANSI, ASME and other standards, which will apply to specific components or equipment used in building construction.

NEC did not tell current American homeowners what to do. AHJ or your insurance company may have something to say about this, but once the structure is completed, NEC is no longer in direct scope.

How many renovations can a homeowner make without obtaining a city permit? Once the permit and city inspector are involved, NEC will apply again.

Please read my last comment "AHJ or your insurance company may have something to say about this, but once the structure is built, NEC is no longer in direct scope", it solves this problem.

For North America, the only instructions for you and your AHJ are in accordance with local and state/provincial administrative laws. And the laws of physics...

For those who are not in Canada, Mexico or the United States; please note that NEC is used inconsistently and arbitrarily by various state and local governments. For example, Ms. List lives in a state controlled at the national level (BS7671), which stipulates all aspects of installation, review, inspection, design, and capabilities. In North America, especially in Mexico and the United States, we can only let AHJ's volatility and uncertainty whim.

This is a big fan of shells. The stock firmware includes a rest interface, so there is no need to get involved with tasmota. All of my Sonoff tasmota equipment seems to be monitored on a regular basis-the short LED flashes from the corners of the room are obvious. Lack of proper recall. The defective Sonoff 16A switch also left a bad smell (and small because it melted...).

You may want to avoid units that must be opened to refresh again. Please refer to https://github.com/ct-Open-Source/tuya-convert/wiki/Compatible-devices for a long list of items that you can refresh without opening them.

Our model is D6932, based on ESP32 dimmer, you can verify it in the ETL link above. We will soon sell ETL certified dimmers. thanks

https://ramuk.intertekconnect.com/WebClients/ITS/DLP/products.nsf/

Some things (talking about things related to the United States):

It's NRTL list, not certification. The following is a brief overview of the process: -The standards issued by UL cover almost everything. -Product manufacturers wishing to obtain a list obtain copies of applicable standards. -Manufacturers design their products to meet or exceed these standards. -Then send the product to the selected NRTL for testing. -If the product passes the test, the list will be published. If the product fails the test, it is returned to the manufacturer for modification and retesting.

There are several NRTL (Nationally Recognized Testing Laboratories) that perform safety tests and lists. The most common ones are UL and Intertek, as well as CSA and TUV. Some laboratories cannot test according to every standard.

NEC (National Electrical Code) is a specification issued by the National Fire Protection Association and adopted by each state. It can be in original form with appendices, or it can be incorporated into the state's own specifications. For example, California has the California Electrical Code, which is mainly NEC, with some additions and changes. Regardless of the form, a state's electrical codes will become part of the state's laws. Lack of permission (needed or not required) does not eliminate code requirements. There are many instances of criminal charges being filed against individuals who engaged in illegal (non-compliant) work but failed to cause injury or death. Of course.

NEC stipulates what must be listed (NRTL). For example, lamps must be listed (with the rise of etsy and everyone using metal products to make industrial-style lamps, this is a special plague) must be listed.

The following is a hypothetical scenario based on what actually happened, which explains why a list is needed: A restaurant commissioned an artist or sculptor to make some custom industrial-style lamps with black iron pipes. The manufacturer has completed the wiring before, knowing that he can buy pipes, fittings, wires, lamp holders and other parts to make lamps and continue to do so. These fixtures are not listed, and the restaurant’s electrical contractor refused to install them because they did not meet the specifications and failed to pass inspections. The restaurant owner instructed the contractor to install some other cheap listing fixtures he had purchased to pass the inspection. After the inspection passed and the contractor left the site, the owner asked his maintenance staff to replace the lamps with customized parts. The restaurant owner didn't know that the manufacturer didn't really know what he was doing when building the fixture, and there was no glued (grounded) metal parts. No one noticed any problems because the lights were working. In one of the iron pipes, there is a wire leaning against a sharp metal edge in the pipe assembly. The fixing device is installed on the wall, and the refrigerating device installed on the wall will vibrate. Over time, the sharp metal edges will wear the insulation of the wires, and the entire lamp will be energized. The circuit breaker will not trip because there is no current return path to power the luminaire due to lack of equipment grounding, and the luminaire remains energized. This problem did not arouse people's attention, because LED bulbs last as long as they are in use until one day, a child stood on the table under the lamp, reached out to grab it, and then got an electric shock.

"List" is not an OSHA (controller of the NRTL certification program) term. It is a term invented by a specific NRTL, and certain parts of the industry and other NRTLs may or may not adopt this term. Many things are not listed-it is "identified" or "categorized."

UL has not officially published standards. UL sets standards and convenes STP. But ANSI is the body that develops the official national version of the standard.

State, county, or city governments can adopt NFPA versions of their various standards. Outside of public places or workplaces, there is no national requirement to adopt building codes or any specific ANSI safety standards for components or equipment in building materials.

Pedantic? Maybe, but terminology and formal definitions are important for these things.

I'm not sure if OSHA uses the word "listed", I'm talking about how it is used in NEC, and NEC specifically refers to "listed". For example, the applicable part of my luminaire example is "410.6 Listing Required. All luminaires, lamp holders, and retrofit kits should be listed."

NRTL "approvals" are divided into three categories (applicable to this discussion, my definition of these categories is very general, by no means comprehensive)

-The listing indicates that the product has passed the tests of the applicable standards, meets these standards, and can be used for general purposes.

-Approval refers to components that are intended to be used for the listed components. Using identified components among the listed components can make the testing process easier because these components do not have to be individually tested.

-Classification (I don't know this well) is for products that have been tested for a specific use or environment. An example I am familiar with is a circuit breaker. Normally, the circuit breakers are only listed in the same manufacturer's panel where these circuit breakers are installed. Some circuit breakers have passed UL classification and can be used on panels of other manufacturers. Confidential use is limited to designated panels, even though the circuit breaker may fit other panels.

Are you sure that UL does not publish standards? They are approved by ANSI, and the standard title under discussion is ULxxxx, where xxxx is the standard number. EX: UL943 is the UL standard for GFCI equipment https://standardscatalog.ul.com/standards/en/standard_943_5

I hope I won't be a little out of place because of my argument, this is not my intention. I just want to make sure that my facts and understanding are correct, and I may learn something in the process.

So, this is all for the safety of the children, we have all heard of it before. In addition, if a child is standing on a dining room table, his/her parents/guardians should pay attention to the situation. In addition, the little guy needs to be grounded, just like birds and squirrels don’t get electrocuted. I would be more worried about overhead lights installed with standard ceiling brackets, and then someone would install a heavy beast made of black iron or similar material behind them.

Oh, seriously, it's called a hook. You make the first paragraph fascinating, add "continue reading" at that point, and then complete the article after the jump. How hard is this to grasp? News sites and blogs have been doing this for decades, but HaD spread five pages of articles to block the blog. The main blog page is a list of articles, not the location of your entire article! Use the [Continue Reading] function.

Huh! This is unintentional. When I return to the desktop, I will add a break.

Thanks! I have considered making a bot that can automatically publish the certificate threshold in the article without reading more, and then write a meta-article about the article bot

As an Australian, I just started looking for WIFI touch switches for our downlights. The starting price of a certified switch is 150 Australian dollars (106 US dollars), which is only *a* switch on the wall panel, especially for multi-switches, while the price of Sonoff switches is about 20 Australian dollars.

In Australia, light switches can only be installed by licensed electricians, and anything that is not certified.

The end result is that any certified product will cause huge price fraud on the part before it is installed.

(Note: Knowing that there is a certification fee and using 240VAC, you don’t want to be cheap, but a 10 times increase in price is a bit expensive)

It is... cost can make the solution impossible to implement. Someone came out to prove Darwin's theory of evolution, came up with a way to bypass protective measures, and freed themselves from the trap of mortals. The safety agency and the regulatory committee then hope to eliminate the newly discovered risk that the person showed...the goal is how to prevent one in a million from happening again. As a result, the other 999,999 people had to pay for more expensive products because the idiot directly affected their own deaths. Of course, the company that produces the product will benefit from it and is also a member of the code committee, but in the case of security threats, this is noble.

For off-grid houses, multiple RPi boards and many discrete controllers (one for each fixture) are not possible. Smart wall switches, such as the Clipsal C-Bus controller board, are also not starters, because they are always in the power load state. Each controller/wall board/RPi is about 0.5W, which quickly exceeds that of household refrigerators. Power, which is 400 watt-hours/day.

This is done in many houses, and the base load power consumption has a great impact.

We need solutions that perform better in terms of standby/phantom power consumption.

The robot seems to have eaten up my more thoughtful and researched comments...

The elephant in the room here is the phantom load caused by standby power consumption and all RPi boards and controllers/- smart wall switches... It can be easily added to 20W and is always on. This is a non-starter when off-grid and has Broader social significance.

"Uncertified equipment violates electrical codes when hardwired into the house."

I will carefully install any fashionable technology into your home electrical system. Even if it is certified, it is not worth it. The value of your house will not increase at all, only the opposite.

Nevertheless, you can still mix the new and the old, and mainly get what you want.

1) X10 device. They have passed the certification. Just connect ESP8266 to the serial X10 controller. That is, the CM17A/TM751 combination, or even the old TRS80 equipment and light controller. Security and isolation.

2) Compared with low-voltage equipment that works directly on the power supply, it is easier (and safer) to use low-voltage equipment after isolation. Do you really need to switch between 120v or 240v AC these days? If you want to switch lights that are already LEDs, consider a low-voltage solution. A good shielded power supply or even a USB charger can power ESP8266 and LEDs well.

It is not worth messing with power cords, especially in old houses with knobs and tube wiring or mobile homes with aluminum wires behind walls made of fire. They rise very fast.

FYI As mentioned in the article, UL is just one of several NRTLs. I heard that other people provide similar services, but the cost is much lower. Although they will not be easily recognized by the public, they (I think) are still valid signs for insurance purposes. It's worth shopping around. (YMMV and IANAL.)

Given all the discussion about safety, is there a good website or article that compares the safest options available for automating and controlling lights?

You don't need to use esp 8266 to open and close. A simple relay with few electronic components can be made into a better, reliable and easy switching device. The link is here. https://www.susthesurfer.com/indoor-motion-sensor-light-switch/

For anyone interested, you can also use MicroPython with these. I can use the following command to flash: esptool.py –baud 460800 write_flash –flash_size=detect 0 esp8266-20180511-v1.9.4.bin

The pins are: 4-wifi signal light 5-power button light 13-relay 14-touch input

Have you heard more about Shelly's UL certification? This article is the only reference I can find. I want to connect Shelly to switches and sockets, but before I hardwire anything, I want to obtain national certification and avoid insurance nightmares in the event of a disaster.

Not yet. I sent a message to their official Facebook group while researching this article, and this is the source of confirmation.

Please be kind and respectful to help make the comment section great. (Comment Policy)

This website uses Akismet to reduce spam. Learn how to handle your comment data.

By using our website and services, you explicitly agree to the placement of our performance, functionality and advertising cookies. learn more